package com.kaoshi.T18;

import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/7 13:58
 * @description
 */
public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一串字符串：");
        String str = input.next();
        System.out.println("请输入需要查找的字符串：");
        String search = input.next();

        String indexs = "";
        int temp = 0;
        while (true){
            int index = str.indexOf(search);
            temp = temp+index+search.length();

            indexs = indexs + (temp-search.length())+" ";
            str = str.substring(index+search.length());
            if (str.length()==0){
                System.out.println("indexs = " + indexs);
                break;
            }
        }
        System.out.println(indexs);

    }
}
